package com.geekaca.oopd3.stringapi;

public class CompareStrandStrbuilder {
    public static void main(String[] args) {
        long start1 = System.currentTimeMillis();
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < 100000; i++) {
            stringBuilder.append(i);
        }
        long end1 = System.currentTimeMillis();
        System.out.println("end1-start1) = " + (end1 - start1));

        long start2 = System.currentTimeMillis();
        String mystr = "";
        for (int i = 0; i < 100000; i++) {
            mystr += i;
        }
        long end2 =System.currentTimeMillis();
        System.out.println("end2-start2 = " + (end2 - start2));

    }
}
